package org.hawk.gwtppc.webtest.tests.fieldsuite;

import org.hawk.gwtppc.webtest.common.Asserts;
import org.hawk.gwtppc.webtest.common.Test;
import org.hawk.gwtppc.webtest.tests.mock.GenericClassMock;
import org.hawk.gwtppc.webtest.tests.mock.SubClassMock1;

public class ToStringAndGenericStringTest implements Test {

	public void run() throws Throwable {
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("serialVersionUID").toString(), 
				"private static final long org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.serialVersionUID");
		
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("staticString").toString(), 
				"private static java.lang.String org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.staticString");
		
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("parent").toString(), 
				"protected org.hawk.gwtppc.webtest.tests.mock.ClassMock org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.parent");
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("parent").toGenericString(), 
				"protected org.hawk.gwtppc.webtest.tests.mock.ClassMock org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.parent");
		
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("parent").toString(), 
				"protected org.hawk.gwtppc.webtest.tests.mock.ClassMock org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.parent");
		Asserts.assertEquals(SubClassMock1.class.getDeclaredField("parent").toGenericString(), 
				"protected org.hawk.gwtppc.webtest.tests.mock.ClassMock org.hawk.gwtppc.webtest.tests.mock.SubClassMock1.parent");
		
		Asserts.assertEquals(GenericClassMock.class.getDeclaredField("genericField").toString(), 
				"java.lang.Object org.hawk.gwtppc.webtest.tests.mock.GenericClassMock.genericField");
		Asserts.assertEquals(GenericClassMock.class.getDeclaredField("genericField").toGenericString(), 
				"X2 org.hawk.gwtppc.webtest.tests.mock.GenericClassMock.genericField");
	}

	public String getName() {
		return "toString()";
	}

}
